package com.yyds.oneservice.mapper;

import com.yyds.oneservice.pojo.CmsSubject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yyds.oneservice.vo.CmsSubjectVo;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
 * <p>
 * 专题表 Mapper 接口
 * </p>
 *
 * @author lxy
 * @since 2022-12-12
 */
public interface CmsSubjectMapper extends BaseMapper<CmsSubject> {

    @Select("select p.id ,p.category_name,  p.title ,p.pic,p.description,p.comment_count,p.love_count,p.forward_count ,p.create_time,u.id user_id, u.username username,u.icon icon\n" +
            "\n" +
            "from cms_subject p join user_member u on  p.user_id=u.id and p.category_name= '萌宠'  ")
    List<CmsSubjectVo> findByM();

    @Select("select p.id ,p.category_name, p.title ,p.pic,p.description,p.comment_count,p.love_count,p.forward_count ,p.create_time,u.id user_id, u.username username,u.icon icon\n" +
            "\n" +
            "from cms_subject p join user_member u on  p.user_id=u.id ")
    List<CmsSubjectVo> findBycmsName();
}
